<?php

namespace module\manage\validate;

use app\Validate;

class Adv extends Validate
{
    /**
     * 所有验证场景需要的字段.
     *
     * @var array<array>
     */
    protected $scene = [
        'save' => ['link', 'title', 'image']
    ];
    /**
     * Get the validation rules that apply to the request.
     *
     * @var array<string>
     */
    protected $rule = [
        'id' => 'require|integer|max:10',  // ID
        'link'  => 'requireWithout:id|max:100',  // 广告链接
        'title' => 'requireWithout:id|max:60',  // 广告标题
        'image' => 'requireWithout:id|max:60',  // 广告图片
    ];
    /**
     * 验证字段描述
     * 
     * @var array<string>
     */
    protected $field = [
        'id' => 'ID',
        'link' => '链接',
        'title' => '标题',
        'image' => '图片',
    ];
}
